<!DOCTYPE html>












  


<html class="theme-next pisces use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">



















  
  
  
  

  
    
    
  

  
    
      
    

    
  

  

  
    
      
    

    
  

  
    
      
    

    
  

  
    
    
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Monda:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Lobster Two:300,300italic,400,400italic,700,700italic|PT Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext">
  






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">

<link rel="stylesheet" href="/css/main.css?v=7.1.2">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.1.2">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.1.2">


  <link rel="icon" type="image/png" sizes="16x16" href="/favicon.ico?v=7.1.2">


  <link rel="mask-icon" href="/images/logo.svg?v=7.1.2" color="#222">







<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '7.1.2',
    sidebar: {"position":"left","display":"hide","offset":12,"onmobile":false,"dimmer":false},
    back2top: true,
    back2top_sidebar: false,
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="视频:https://www.bilibili.com/video/av52167219PS:建议先看课程视频1-2篇，再根据视频或文档部署，如有问题，及时与@若泽数据J哥联系。  一.准备工作1.离线部署主要分为三块:a.MySQL离线部署b.CM离线部署c.Parcel文件离线源部署">
<meta name="keywords" content="CDH5.16.1">
<meta property="og:type" content="article">
<meta property="og:title" content="CDH5.16.1集群企业真正离线部署">
<meta property="og:url" content="https://www.dudefu.tk/CDH5-16-1集群企业真正离线部署.html">
<meta property="og:site_name" content="The Future">
<meta property="og:description" content="视频:https://www.bilibili.com/video/av52167219PS:建议先看课程视频1-2篇，再根据视频或文档部署，如有问题，及时与@若泽数据J哥联系。  一.准备工作1.离线部署主要分为三块:a.MySQL离线部署b.CM离线部署c.Parcel文件离线源部署">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTMntgWCB2RNGM6yIaUia6hAywAgazVIRPibSZlCJgp4pTTQhWM0fjRVaQ/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTNe2xHBYR8ibmF1sFhyLJngtqibTJylSZkCmcmBD3HtJu2Pw9G8o5WVQg/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTjcibnIMwV6TJwVHVQZOLHnNsMA45g4hMa43LEgZv0AwdASia0CNibEhug/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTq1NNOhRffwbBvXOezndFvm0kSdWhWH2hBHYLOzVv8fw4rdU2ibFvJcw/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTjiceg4wvCaDzZySicaia4ZCwKjcyIBN1tW6L3nmtVkeMdt4TIiawiceia1DQ/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT3kX26zl0BFWoNvOqbF1FR6BvYjVoyC9eibOmZd7NE3ufZMVyfyLjBhg/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTDQOX5gC9KRxIUIY1eL561QticAaz23IX1ogYVRiajwXlbibddeax1a33w/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTkp6Dw0RMWkoFTd4sbzBnrWiblxVkWLoPZSMziaRgY2DSE03fQRmBgJ4w/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT0CQtn7eQbrjkPmTgQA6ye22UNfdZ618RexePfdrupRPtTrZlHLQRPw/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT4qoAXY69p0jSUgGFmlzq5MAQ4xoRyu1B2ftqt3BKwJ8fZ8f7ogWyuw/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTtF5tKDhqYhmlp4AasDK71tJ6BtAWk10FBibeJziaEPbWcbwFXxiaWtxfQ/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTkvbFkWcLiawvHnOtSv5VORKXSKS8DurU6DQHnuzNp0JLmstVhNXRnvA/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTMJE0wE0Apia0rSYXKVJzoRWIuia2ccrONV9PiaePpv4phgftKiax9PAfPQ/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">
<meta property="og:updated_time" content="2020-03-25T09:18:19.147Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CDH5.16.1集群企业真正离线部署">
<meta name="twitter:description" content="视频:https://www.bilibili.com/video/av52167219PS:建议先看课程视频1-2篇，再根据视频或文档部署，如有问题，及时与@若泽数据J哥联系。  一.准备工作1.离线部署主要分为三块:a.MySQL离线部署b.CM离线部署c.Parcel文件离线源部署">
<meta name="twitter:image" content="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTMntgWCB2RNGM6yIaUia6hAywAgazVIRPibSZlCJgp4pTTQhWM0fjRVaQ/640?wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1">





  
  
  <link rel="canonical" href="https://www.dudefu.tk/CDH5-16-1集群企业真正离线部署">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>CDH5.16.1集群企业真正离线部署 | The Future</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">The Future</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <h1 class="site-subtitle" itemprop="description">Stay hungry,stay foolish.</h1>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
    
      
    

    
      
    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
    
      
    

    
      
    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档<span class="badge">125</span></a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
    
      
    

    
      
    

    <a href="/categories" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类<span class="badge">15</span></a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
    
      
    

    
      
    

    <a href="/tags" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签<span class="badge">63</span></a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-something">

    
    
    
      
    

    
      
    

    <a href="/something" rel="section"><i class="menu-item-icon fa fa-fw fa-paper-plane"></i> <br>干货</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
    
      
    

    
      
    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>

      
      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  
    <div class="reading-progress-bar"></div>
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://www.dudefu.tk/CDH5-16-1集群企业真正离线部署.html">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Daniel X">
      <meta itemprop="description" content="專注于大数据技術，分享干货">
      <meta itemprop="image" content="https://hexoblog-1254111960.cos.ap-guangzhou.myqcloud.com/HexoBlog-tou.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="The Future">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">CDH5.16.1集群企业真正离线部署

              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-03-25 16:58:47 / 修改时间：17:18:19" itemprop="dateCreated datePublished" datetime="2020-03-25T16:58:47+08:00">2020-03-25</time>
            

            
              

              
            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope="" itemtype="http://schema.org/Thing"><a href="/categories/大数据/" itemprop="url" rel="index"><span itemprop="name">大数据</span></a></span>

                
                
              
            </span>
          

          
            
            
              
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
            
                <span class="post-meta-item-text">评论数：</span>
                <a href="/CDH5-16-1集群企业真正离线部署.html#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/CDH5-16-1集群企业真正离线部署.html" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          
            <span id="/CDH5-16-1集群企业真正离线部署.html" class="leancloud_visitors" data-flag-title="CDH5.16.1集群企业真正离线部署">
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>视频:<span class="exturl" data-url="aHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tL3ZpZGVvL2F2NTIxNjcyMTk=" title="https://www.bilibili.com/video/av52167219">https://www.bilibili.com/video/av52167219<i class="fa fa-external-link"></i></span><br>PS:建议先看课程视频1-2篇，再根据视频或文档部署，<br>如有问题，及时与@若泽数据J哥联系。</p>
<hr>
<h2 id="一-准备工作"><a href="#一-准备工作" class="headerlink" title="一.准备工作"></a>一.准备工作</h2><h4 id="1-离线部署主要分为三块"><a href="#1-离线部署主要分为三块" class="headerlink" title="1.离线部署主要分为三块:"></a>1.离线部署主要分为三块:</h4><p>a.MySQL离线部署<br>b.CM离线部署<br>c.Parcel文件离线源部署</p>
<a id="more"></a>
<h4 id="2-规划"><a href="#2-规划" class="headerlink" title="2.规划:"></a>2.规划:</h4><table>
<thead>
<tr>
<th style="text-align:left">节点</th>
<th style="text-align:left">MySQL部署组件</th>
<th style="text-align:left">Parcel文件离线源</th>
<th style="text-align:left">CM服务进程</th>
<th style="text-align:left">大数据组件</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">hadoop001</td>
<td style="text-align:left">MySQL</td>
<td style="text-align:left">Parcel</td>
<td style="text-align:left">Activity Monitor</td>
<td style="text-align:left">NN RM DN NM</td>
</tr>
<tr>
<td style="text-align:left">hadoop002</td>
<td style="text-align:left"></td>
<td style="text-align:left"></td>
<td style="text-align:left">Alert Publisher Event Server</td>
<td style="text-align:left">DN NM</td>
</tr>
<tr>
<td style="text-align:left">hadoop003</td>
<td style="text-align:left"></td>
<td style="text-align:left"></td>
<td style="text-align:left">Host Monitor Service Monitor</td>
<td style="text-align:left">DN NM</td>
</tr>
</tbody>
</table>
<h3 id="3-下载源"><a href="#3-下载源" class="headerlink" title="3.下载源:"></a>3.下载源:</h3><ul>
<li>CM<br>cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz</li>
<li>Parcel<br>CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel<br>CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1<br>manifest.json</li>
<li>JDK<br><span class="exturl" data-url="aHR0cHM6Ly93d3cub3JhY2xlLmNvbS90ZWNobmV0d29yay9qYXZhL2phdmFzZS9kb3dubG9hZHMvamF2YS1hcmNoaXZlLWphdmFzZTgtMjE3NzY0OC5odG1s" title="https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html">https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html<i class="fa fa-external-link"></i></span><br>下载jdk-8u202-linux-x64.tar.gz</li>
<li>MySQL<br><span class="exturl" data-url="aHR0cHM6Ly9kZXYubXlzcWwuY29tL2Rvd25sb2Fkcy9teXNxbC81LjcuaHRtbCNkb3dubG9hZHM=" title="https://dev.mysql.com/downloads/mysql/5.7.html#downloads">https://dev.mysql.com/downloads/mysql/5.7.html#downloads<i class="fa fa-external-link"></i></span><br>下载mysql-5.7.26-el7-x86_64.tar.gz</li>
<li>MySQL jdbc jar<br>mysql-connector-java-5.1.47.jar<br>下载完成后要重命名去掉版本号，<br>mv mysql-connector-java-5.1.47.jar mysql-connector-java.jar</li>
</ul>
<hr>
<h3 id="准备好百度云-下载安装包"><a href="#准备好百度云-下载安装包" class="headerlink" title="准备好百度云,下载安装包:"></a>准备好百度云,下载安装包:</h3><p>链接:<span class="exturl" data-url="aHR0cHM6Ly9wYW4uYmFpZHUuY29tL3MvMTBzLU5hRkxmenRLdVdJbVpUaUJNakE=" title="https://pan.baidu.com/s/10s-NaFLfztKuWImZTiBMjA">https://pan.baidu.com/s/10s-NaFLfztKuWImZTiBMjA<i class="fa fa-external-link"></i></span>  密码:viqp</p>
<h2 id="二-集群节点初始化"><a href="#二-集群节点初始化" class="headerlink" title="二.集群节点初始化"></a>二.集群节点初始化</h2><h3 id="1-阿里云上海区购买3台，按量付费虚拟机"><a href="#1-阿里云上海区购买3台，按量付费虚拟机" class="headerlink" title="1.阿里云上海区购买3台，按量付费虚拟机"></a>1.阿里云上海区购买3台，按量付费虚拟机</h3><p>CentOS7.2操作系统，2核8G最低配置</p>
<h3 id="2-当前笔记本或台式机配置hosts文件"><a href="#2-当前笔记本或台式机配置hosts文件" class="headerlink" title="2.当前笔记本或台式机配置hosts文件"></a>2.当前笔记本或台式机配置hosts文件</h3><ul>
<li>MAC: /etc/hosts</li>
<li>Window: C:\windows\system32\drivers\etc\hosts</li>
</ul>
<p>公网地址:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1106.15.234.222 hadoop001  </span><br><span class="line">2106.15.235.200 hadoop002  </span><br><span class="line">3106.15.234.239 hadoop003</span><br></pre></td></tr></table></figure>
<h3 id="3-设置所有节点的hosts文件"><a href="#3-设置所有节点的hosts文件" class="headerlink" title="3.设置所有节点的hosts文件"></a>3.设置所有节点的hosts文件</h3><p>私有地址、内网地址:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1echo &quot;172.19.7.96 hadoop001&quot;&gt;&gt; /etc/hosts</span><br><span class="line">2echo &quot;172.19.7.98 hadoop002&quot;&gt;&gt; /etc/hosts</span><br><span class="line">3echo &quot;172.19.7.97 hadoop003&quot;&gt;&gt; /etc/hosts</span><br></pre></td></tr></table></figure>
<h3 id="4-关闭所有节点的防火墙及清空规则"><a href="#4-关闭所有节点的防火墙及清空规则" class="headerlink" title="4.关闭所有节点的防火墙及清空规则"></a>4.关闭所有节点的防火墙及清空规则</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1systemctl stop firewalld </span><br><span class="line">2systemctl disable firewalld</span><br><span class="line">3iptables -F</span><br></pre></td></tr></table></figure>
<h3 id="5-关闭所有节点的selinux"><a href="#5-关闭所有节点的selinux" class="headerlink" title="5.关闭所有节点的selinux"></a>5.关闭所有节点的selinux</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1vi /etc/selinux/config</span><br><span class="line">2将SELINUX=enforcing改为SELINUX=disabled </span><br><span class="line">3设置后需要重启才能生效</span><br></pre></td></tr></table></figure>
<h3 id="6-设置所有节点的时区一致及时钟同步"><a href="#6-设置所有节点的时区一致及时钟同步" class="headerlink" title="6.设置所有节点的时区一致及时钟同步"></a>6.设置所有节点的时区一致及时钟同步</h3><p>6.1.时区</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"> 1[root@hadoop001 ~]# date</span><br><span class="line"> 2Sat May 11 10:07:53 CST 2019</span><br><span class="line"> 3[root@hadoop001 ~]# timedatectl</span><br><span class="line"> 4      Local time: Sat 2019-05-11 10:10:31 CST</span><br><span class="line"> 5  Universal time: Sat 2019-05-11 02:10:31 UTC</span><br><span class="line"> 6        RTC time: Sat 2019-05-11 10:10:29</span><br><span class="line"> 7       Time zone: Asia/Shanghai (CST, +0800)</span><br><span class="line"> 8     NTP enabled: yes</span><br><span class="line"> 9NTP synchronized: yes</span><br><span class="line">10 RTC in local TZ: yes</span><br><span class="line">11      DST active: n/a</span><br></pre></td></tr></table></figure>
<h5 id="查看命令帮助，学习至关重要，无需百度，太👎"><a href="#查看命令帮助，学习至关重要，无需百度，太👎" class="headerlink" title="查看命令帮助，学习至关重要，无需百度，太👎"></a>查看命令帮助，学习至关重要，无需百度，太👎</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"> 1[root@hadoop001 ~]# timedatectl --help</span><br><span class="line"> 2timedatectl [OPTIONS...] COMMAND ...</span><br><span class="line"> 3Query or change system time and date settings.</span><br><span class="line"> 4  -h --help                Show this help message</span><br><span class="line"> 5     --version             Show package version</span><br><span class="line"> 6     --no-pager            Do not pipe output into a pager</span><br><span class="line"> 7     --no-ask-password     Do not prompt for password</span><br><span class="line"> 8  -H --host=[USER@]HOST    Operate on remote host</span><br><span class="line"> 9  -M --machine=CONTAINER   Operate on local container</span><br><span class="line">10     --adjust-system-clock Adjust system clock when changing local RTC mode</span><br><span class="line">11Commands:</span><br><span class="line">12  status                   Show current time settings</span><br><span class="line">13  set-time TIME            Set system time</span><br><span class="line">14  set-timezone ZONE        Set system time zone</span><br><span class="line">15  list-timezones           Show known time zones</span><br><span class="line">16  set-local-rtc BOOL       Control whether RTC is in local time</span><br><span class="line">17  set-ntp BOOL             Control whether NTP is enabled</span><br></pre></td></tr></table></figure>
<h5 id="查看哪些时区"><a href="#查看哪些时区" class="headerlink" title="查看哪些时区"></a>查看哪些时区</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop001 ~]# timedatectl list-timezones</span><br><span class="line">2Africa/Abidjan</span><br><span class="line">3Africa/Accra</span><br><span class="line">4Africa/Addis_Ababa</span><br><span class="line">5Africa/Algiers</span><br><span class="line">6Africa/Asmara</span><br><span class="line">7Africa/Bamako</span><br></pre></td></tr></table></figure>
<h5 id="所有节点设置亚洲上海时区"><a href="#所有节点设置亚洲上海时区" class="headerlink" title="所有节点设置亚洲上海时区"></a>所有节点设置亚洲上海时区</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop001 ~]# timedatectl set-timezone Asia/Shanghai</span><br><span class="line">2[root@hadoop002 ~]# timedatectl set-timezone Asia/Shanghai</span><br><span class="line">3[root@hadoop003 ~]# timedatectl set-timezone Asia/Shanghai</span><br></pre></td></tr></table></figure>
<p>6.2.时间</p>
<h5 id="所有节点安装ntp"><a href="#所有节点安装ntp" class="headerlink" title="所有节点安装ntp"></a>所有节点安装ntp</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop001 ~]# yum install -y ntp</span><br></pre></td></tr></table></figure>
<h5 id="选取hadoop001为ntp的主节点"><a href="#选取hadoop001为ntp的主节点" class="headerlink" title="选取hadoop001为ntp的主节点"></a>选取hadoop001为ntp的主节点</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop001 ~]# vi /etc/ntp.conf</span><br></pre></td></tr></table></figure>
<h5 id="time"><a href="#time" class="headerlink" title="time"></a>time</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">1server 0.asia.pool.ntp.org</span><br><span class="line">2server 1.asia.pool.ntp.org</span><br><span class="line">3server 2.asia.pool.ntp.org</span><br><span class="line">4server 3.asia.pool.ntp.org</span><br></pre></td></tr></table></figure>
<h5 id="当外部时间不可用时，可使用本地硬件时间"><a href="#当外部时间不可用时，可使用本地硬件时间" class="headerlink" title="当外部时间不可用时，可使用本地硬件时间"></a>当外部时间不可用时，可使用本地硬件时间</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1server 127.127.1.0 iburst local clock</span><br></pre></td></tr></table></figure>
<h5 id="允许哪些网段的机器来同步时间"><a href="#允许哪些网段的机器来同步时间" class="headerlink" title="允许哪些网段的机器来同步时间"></a>允许哪些网段的机器来同步时间</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1restrict 172.19.7.0 mask 255.255.255.0 nomodify notrap</span><br></pre></td></tr></table></figure>
<h5 id="开启ntpd及查看状态"><a href="#开启ntpd及查看状态" class="headerlink" title="开启ntpd及查看状态"></a>开启ntpd及查看状态</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"> 1[root@hadoop001 ~]# systemctl start ntpd</span><br><span class="line"> 2[root@hadoop001 ~]# systemctl status ntpd</span><br><span class="line"> 3● ntpd.service - Network Time Service</span><br><span class="line"> 4   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)</span><br><span class="line"> 5   Active: active (running) since Sat 2019-05-11 10:15:00 CST; 11min ago</span><br><span class="line"> 6 Main PID: 18518 (ntpd)</span><br><span class="line"> 7   CGroup: /system.slice/ntpd.service</span><br><span class="line"> 8           └─18518 /usr/sbin/ntpd -u ntp:ntp -g</span><br><span class="line"> 9May 11 10:15:00 hadoop001 systemd[1]: Starting Network Time Service...</span><br><span class="line">10May 11 10:15:00 hadoop001 ntpd[18518]: proto: precision = 0.088 usec</span><br><span class="line">11May 11 10:15:00 hadoop001 ntpd[18518]: 0.0.0.0 c01d 0d kern kernel time sync enabled</span><br><span class="line">12May 11 10:15:00 hadoop001 systemd[1]: Started Network Time Service.</span><br></pre></td></tr></table></figure>
<h5 id="验证"><a href="#验证" class="headerlink" title="验证"></a>验证</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop001 ~]# ntpq -p</span><br><span class="line">2     remote           refid      st t when poll reach   delay   offset  jitter</span><br><span class="line">3==============================================================================</span><br><span class="line">4 LOCAL(0)        .LOCL.          10 l  726   64    0    0.000    0.000   0.000</span><br></pre></td></tr></table></figure>
<h5 id="其他从节点停止禁用ntpd服务"><a href="#其他从节点停止禁用ntpd服务" class="headerlink" title="其他从节点停止禁用ntpd服务"></a>其他从节点停止禁用ntpd服务</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">1[root@hadoop002 ~]# systemctl stop ntpd</span><br><span class="line">2[root@hadoop002 ~]# systemctl disable ntpd</span><br><span class="line">3Removed symlink /etc/systemd/system/multi-user.target.wants/ntpd.service.</span><br><span class="line">4[root@hadoop002 ~]# /usr/sbin/ntpdate hadoop001</span><br><span class="line">511 May 10:29:22 ntpdate[9370]: adjust time server 172.19.7.96 offset 0.000867 sec</span><br></pre></td></tr></table></figure>
<h5 id="每天凌晨同步hadoop001节点时间"><a href="#每天凌晨同步hadoop001节点时间" class="headerlink" title="每天凌晨同步hadoop001节点时间"></a>每天凌晨同步hadoop001节点时间</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"> 1[root@hadoop002 ~]# crontab -e</span><br><span class="line"> 200 00 * * * /usr/sbin/ntpdate hadoop001  </span><br><span class="line"> 3[root@hadoop003 ~]# systemctl stop ntpd</span><br><span class="line"> 4[root@hadoop004 ~]# systemctl disable ntpd</span><br><span class="line"> 5Removed symlink /etc/systemd/system/multi-user.target.wants/ntpd.service.</span><br><span class="line"> 6[root@hadoop005 ~]# /usr/sbin/ntpdate hadoop001</span><br><span class="line"> 711 May 10:29:22 ntpdate[9370]: adjust time server 172.19.7.96 offset 0.000867 sec</span><br><span class="line"> 8#每天凌晨同步hadoop001节点时间</span><br><span class="line"> 9[root@hadoop003 ~]# crontab -e</span><br><span class="line">1000 00 * * * /usr/sbin/ntpdate hadoop001</span><br></pre></td></tr></table></figure>
<h3 id="7-部署集群的JDK"><a href="#7-部署集群的JDK" class="headerlink" title="7.部署集群的JDK"></a>7.部署集群的JDK</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">1mkdir /usr/java</span><br><span class="line">2tar -xzvf jdk-8u45-linux-x64.tar.gz -C /usr/java/</span><br><span class="line">3#切记必须修正所属用户及用户组</span><br><span class="line">4chown -R root:root /usr/java/jdk1.8.0_45</span><br><span class="line">5echo &quot;export JAVA_HOME=/usr/java/jdk1.8.0_45&quot; &gt;&gt; /etc/profile</span><br><span class="line">6echo &quot;export PATH=$&#123;JAVA_HOME&#125;/bin:$&#123;PATH&#125;&quot; &gt;&gt; /etc/profile</span><br><span class="line">7source /etc/profile</span><br><span class="line">8which java</span><br></pre></td></tr></table></figure>
<h3 id="8-hadoop001节点离线部署MySQL5-7-假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档"><a href="#8-hadoop001节点离线部署MySQL5-7-假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档" class="headerlink" title="8.hadoop001节点离线部署MySQL5.7(假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档)"></a>8.hadoop001节点离线部署MySQL5.7(假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档)</h3><ul>
<li>文档链接:<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL0hhY2tlcnVuY2xlL015U1FM" title="https://github.com/Hackeruncle/MySQL">https://github.com/Hackeruncle/MySQL<i class="fa fa-external-link"></i></span></li>
<li>视频链接:<span class="exturl" data-url="aHR0cHM6Ly9wYW4uYmFpZHUuY29tL3MvMWpkTThXZUlnOHN5VTBldkwxLXRET1E=" title="https://pan.baidu.com/s/1jdM8WeIg8syU0evL1-tDOQ">https://pan.baidu.com/s/1jdM8WeIg8syU0evL1-tDOQ<i class="fa fa-external-link"></i></span>  密码:whic</li>
</ul>
<h3 id="9-创建CDH的元数据库和用户、amon服务的数据库及用户"><a href="#9-创建CDH的元数据库和用户、amon服务的数据库及用户" class="headerlink" title="9.创建CDH的元数据库和用户、amon服务的数据库及用户"></a>9.创建CDH的元数据库和用户、amon服务的数据库及用户</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">1create database cmf DEFAULT CHARACTER SET utf8;</span><br><span class="line">2create database amon DEFAULT CHARACTER SET utf8;</span><br><span class="line">3grant all on cmf.* TO &apos;cmf&apos;@&apos;%&apos; IDENTIFIED BY &apos;Ruozedata123456!&apos;;</span><br><span class="line">4grant all on amon.* TO &apos;amon&apos;@&apos;%&apos; IDENTIFIED BY &apos;Ruozedata123456!&apos;;</span><br><span class="line">5flush privileges;</span><br></pre></td></tr></table></figure>
<h3 id="10-hadoop001节点部署mysql-jdbc-jar"><a href="#10-hadoop001节点部署mysql-jdbc-jar" class="headerlink" title="10.hadoop001节点部署mysql jdbc jar"></a>10.hadoop001节点部署mysql jdbc jar</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">1mkdir -p /usr/share/java/</span><br><span class="line">2cp mysql-connector-java.jar /usr/share/java/</span><br></pre></td></tr></table></figure>
<h2 id="三-CDH部署"><a href="#三-CDH部署" class="headerlink" title="三.CDH部署"></a>三.CDH部署</h2><h3 id="1-离线部署cm-server及agent"><a href="#1-离线部署cm-server及agent" class="headerlink" title="1.离线部署cm server及agent"></a>1.离线部署cm server及agent</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"> 11.1.所有节点创建目录及解压</span><br><span class="line"> 2mkdir /opt/cloudera-manager</span><br><span class="line"> 3tar -zxvf cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz -C /opt/cloudera-manager/</span><br><span class="line"> 41.2.所有节点修改agent的配置，指向server的节点hadoop001</span><br><span class="line"> 5sed -i &quot;s/server_host=localhost/server_host=hadoop001/g&quot; /opt/cloudera-manager/cm-5.16.1/etc/cloudera-scm-agent/config.ini</span><br><span class="line"> 61.3.主节点修改server的配置:</span><br><span class="line"> 7vi /opt/cloudera-manager/cm-5.16.1/etc/cloudera-scm-server/db.properties </span><br><span class="line"> 8com.cloudera.cmf.db.type=mysql</span><br><span class="line"> 9com.cloudera.cmf.db.host=hadoop001</span><br><span class="line">10com.cloudera.cmf.db.name=cmf</span><br><span class="line">11com.cloudera.cmf.db.user=cmf</span><br><span class="line">12com.cloudera.cmf.db.password=Ruozedata123456!</span><br><span class="line">13com.cloudera.cmf.db.setupType=EXTERNAL</span><br><span class="line">141.4.所有节点创建用户</span><br><span class="line">15useradd --system --home=/opt/cloudera-manager/cm-5.16.1/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment &quot;Cloudera SCM User&quot; cloudera-scm</span><br><span class="line">161.5.目录修改用户及用户组</span><br><span class="line">17chown -R cloudera-scm:cloudera-scm /opt/cloudera-manager</span><br></pre></td></tr></table></figure>
<h3 id="2-hadoop001节点部署离线parcel源"><a href="#2-hadoop001节点部署离线parcel源" class="headerlink" title="2.hadoop001节点部署离线parcel源"></a>2.hadoop001节点部署离线parcel源</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"> 12.1.部署离线parcel源</span><br><span class="line"> 2$ mkdir -p /opt/cloudera/parcel-repo</span><br><span class="line"> 3$ ll</span><br><span class="line"> 4total 3081664</span><br><span class="line"> 5-rw-r--r-- 1 root root 2127506677 May  9 18:04 CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel</span><br><span class="line"> 6-rw-r--r-- 1 root root         41 May  9 18:03 CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1</span><br><span class="line"> 7-rw-r--r-- 1 root root  841524318 May  9 18:03 cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz</span><br><span class="line"> 8-rw-r--r-- 1 root root  185515842 Aug 10  2017 jdk-8u144-linux-x64.tar.gz</span><br><span class="line"> 9-rw-r--r-- 1 root root      66538 May  9 18:03 manifest.json</span><br><span class="line">10-rw-r--r-- 1 root root     989495 May 25  2017 mysql-connector-java.jar</span><br><span class="line">11$ cp CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel /opt/cloudera/parcel-repo/</span><br><span class="line">12#切记cp时，重命名去掉1，不然在部署过程CM认为如上文件下载未完整，会持续下载</span><br><span class="line">13$ cp CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha1 /opt/cloudera/parcel-repo/CDH-5.16.1-1.cdh5.16.1.p0.3-el7.parcel.sha</span><br><span class="line">14$ cp manifest.json /opt/cloudera/parcel-repo/</span><br><span class="line">152.2.目录修改用户及用户组</span><br><span class="line">16$ chown -R cloudera-scm:cloudera-scm /opt/cloudera/</span><br></pre></td></tr></table></figure>
<h3 id="3-所有节点创建软件安装目录、用户及用户组权限"><a href="#3-所有节点创建软件安装目录、用户及用户组权限" class="headerlink" title="3.所有节点创建软件安装目录、用户及用户组权限"></a>3.所有节点创建软件安装目录、用户及用户组权限</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">1mkdir -p /opt/cloudera/parcels</span><br><span class="line">2chown -R cloudera-scm:cloudera-scm /opt/cloudera/</span><br></pre></td></tr></table></figure>
<h3 id="4-hadoop001节点启动Server"><a href="#4-hadoop001节点启动Server" class="headerlink" title="4.hadoop001节点启动Server"></a>4.hadoop001节点启动Server</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">14.1.启动server</span><br><span class="line">2/opt/cloudera-manager/cm-5.16.1/etc/init.d/cloudera-scm-server start</span><br><span class="line">34.2.阿里云web界面，设置该hadoop001节点防火墙放开7180端口</span><br><span class="line">44.3.等待1min，打开 http://hadoop001:7180 账号密码:admin/admin</span><br><span class="line">54.4.假如打不开，去看server的log，根据错误仔细排查错误</span><br></pre></td></tr></table></figure>
<h3 id="5-所有节点启动Agent"><a href="#5-所有节点启动Agent" class="headerlink" title="5.所有节点启动Agent"></a>5.所有节点启动Agent</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">1/opt/cloudera-manager/cm-5.16.1/etc/init.d/cloudera-scm-agent start</span><br></pre></td></tr></table></figure>
<h3 id="6-接下来，全部Web界面操作"><a href="#6-接下来，全部Web界面操作" class="headerlink" title="6.接下来，全部Web界面操作"></a>6.接下来，全部Web界面操作</h3><p><span class="exturl" data-url="aHR0cDovL2hhZG9vcDAwMTo3MTgwLw==" title="http://hadoop001:7180/">http://hadoop001:7180/<i class="fa fa-external-link"></i></span><br>账号密码:admin/admin</p>
<h3 id="7-欢迎使用Cloudera-Manager–最终用户许可条款与条件。勾选"><a href="#7-欢迎使用Cloudera-Manager–最终用户许可条款与条件。勾选" class="headerlink" title="7.欢迎使用Cloudera Manager–最终用户许可条款与条件。勾选"></a>7.欢迎使用Cloudera Manager–最终用户许可条款与条件。勾选</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTMntgWCB2RNGM6yIaUia6hAywAgazVIRPibSZlCJgp4pTTQhWM0fjRVaQ/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="8-欢迎使用Cloudera-Manager–您想要部署哪个版本？选择Cloudera-Express免费版本"><a href="#8-欢迎使用Cloudera-Manager–您想要部署哪个版本？选择Cloudera-Express免费版本" class="headerlink" title="8.欢迎使用Cloudera Manager–您想要部署哪个版本？选择Cloudera Express免费版本"></a>8.欢迎使用Cloudera Manager–您想要部署哪个版本？选择Cloudera Express免费版本</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTNe2xHBYR8ibmF1sFhyLJngtqibTJylSZkCmcmBD3HtJu2Pw9G8o5WVQg/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="9-感谢您选择Cloudera-Manager和CDH"><a href="#9-感谢您选择Cloudera-Manager和CDH" class="headerlink" title="9.感谢您选择Cloudera Manager和CDH"></a>9.感谢您选择Cloudera Manager和CDH</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTjcibnIMwV6TJwVHVQZOLHnNsMA45g4hMa43LEgZv0AwdASia0CNibEhug/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="10-为CDH集群安装指导主机。选择-当前管理的主机-，全部勾选"><a href="#10-为CDH集群安装指导主机。选择-当前管理的主机-，全部勾选" class="headerlink" title="10.为CDH集群安装指导主机。选择[当前管理的主机]，全部勾选"></a>10.为CDH集群安装指导主机。选择[当前管理的主机]，全部勾选</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTq1NNOhRffwbBvXOezndFvm0kSdWhWH2hBHYLOzVv8fw4rdU2ibFvJcw/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="11-选择存储库"><a href="#11-选择存储库" class="headerlink" title="11.选择存储库"></a>11.选择存储库</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTjiceg4wvCaDzZySicaia4ZCwKjcyIBN1tW6L3nmtVkeMdt4TIiawiceia1DQ/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="12-集群安装–正在安装选定Parcel假如"><a href="#12-集群安装–正在安装选定Parcel假如" class="headerlink" title="12.集群安装–正在安装选定Parcel假如"></a>12.集群安装–正在安装选定Parcel假如</h3><p>本地parcel离线源配置正确，则”下载”阶段瞬间完成，其余阶段视节点数与内部网络情况决定。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT3kX26zl0BFWoNvOqbF1FR6BvYjVoyC9eibOmZd7NE3ufZMVyfyLjBhg/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="13-检查主机正确性"><a href="#13-检查主机正确性" class="headerlink" title="13.检查主机正确性"></a>13.检查主机正确性</h3><p><img src="" alt="img"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"> 113.1.建议将/proc/sys/vm/swappiness设置为最大值10。</span><br><span class="line"> 2swappiness值控制操作系统尝试交换内存的积极；</span><br><span class="line"> 3swappiness=0：表示最大限度使用物理内存，之后才是swap空间；</span><br><span class="line"> 4swappiness=100：表示积极使用swap分区，并且把内存上的数据及时搬迁到swap空间；</span><br><span class="line"> 5如果是混合服务器，不建议完全禁用swap，可以尝试降低swappiness。</span><br><span class="line"> 6临时调整：</span><br><span class="line"> 7sysctl vm.swappiness=10</span><br><span class="line"> 8永久调整：</span><br><span class="line"> 9cat &lt;&lt; EOF &gt;&gt; /etc/sysctl.conf</span><br><span class="line">10# Adjust swappiness value</span><br><span class="line">11vm.swappiness=10</span><br><span class="line">12EOF</span><br><span class="line">1313.2.已启用透明大页面压缩，可能会导致重大性能问题，建议禁用此设置。</span><br><span class="line">14临时调整：</span><br><span class="line">15echo never &gt; /sys/kernel/mm/transparent_hugepage/defrag</span><br><span class="line">16echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled</span><br><span class="line">17永久调整：</span><br><span class="line">18cat &lt;&lt; EOF &gt;&gt; /etc/rc.d/rc.local</span><br><span class="line">19# Disable transparent_hugepage</span><br><span class="line">20echo never &gt; /sys/kernel/mm/transparent_hugepage/defrag</span><br><span class="line">21echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled</span><br><span class="line">22EOF</span><br><span class="line">23# centos7.x系统，需要为&quot;/etc/rc.d/rc.local&quot;文件赋予执行权限</span><br><span class="line">24chmod +x /etc/rc.d/rc.local</span><br></pre></td></tr></table></figure>
<h3 id="14-自定义服务，选择部署Zookeeper、HDFS、Yarn服务"><a href="#14-自定义服务，选择部署Zookeeper、HDFS、Yarn服务" class="headerlink" title="14.自定义服务，选择部署Zookeeper、HDFS、Yarn服务"></a>14.自定义服务，选择部署Zookeeper、HDFS、Yarn服务</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTDQOX5gC9KRxIUIY1eL561QticAaz23IX1ogYVRiajwXlbibddeax1a33w/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="15-自定义角色分配"><a href="#15-自定义角色分配" class="headerlink" title="15.自定义角色分配"></a>15.自定义角色分配</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTkp6Dw0RMWkoFTd4sbzBnrWiblxVkWLoPZSMziaRgY2DSE03fQRmBgJ4w/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="16-数据库设置"><a href="#16-数据库设置" class="headerlink" title="16.数据库设置"></a>16.数据库设置</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT0CQtn7eQbrjkPmTgQA6ye22UNfdZ618RexePfdrupRPtTrZlHLQRPw/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="17-审改设置，默认即可"><a href="#17-审改设置，默认即可" class="headerlink" title="17.审改设置，默认即可"></a>17.审改设置，默认即可</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOT4qoAXY69p0jSUgGFmlzq5MAQ4xoRyu1B2ftqt3BKwJ8fZ8f7ogWyuw/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="18-首次运行"><a href="#18-首次运行" class="headerlink" title="18.首次运行"></a>18.首次运行</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTtF5tKDhqYhmlp4AasDK71tJ6BtAWk10FBibeJziaEPbWcbwFXxiaWtxfQ/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="19-恭喜您"><a href="#19-恭喜您" class="headerlink" title="19.恭喜您!"></a>19.恭喜您!</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTkvbFkWcLiawvHnOtSv5VORKXSKS8DurU6DQHnuzNp0JLmstVhNXRnvA/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<h3 id="20-主页"><a href="#20-主页" class="headerlink" title="20.主页"></a>20.主页</h3><p><img src="https://mmbiz.qpic.cn/mmbiz_png/m7Lx6FicJmUmSZI8m74xFUKB6wzFsFMOTMJE0wE0Apia0rSYXKVJzoRWIuia2ccrONV9PiaePpv4phgftKiax9PAfPQ/640?wx_fmt=png&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" alt="img"></p>
<hr>
<h3 id="CDH全套课程目录，如有buy，加微信-ruoze-star"><a href="#CDH全套课程目录，如有buy，加微信-ruoze-star" class="headerlink" title="CDH全套课程目录，如有buy，加微信(ruoze_star)"></a>CDH全套课程目录，如有buy，加微信(ruoze_star)</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line"> 1    0.青云环境介绍和使用 </span><br><span class="line"> 2    1.Preparation        </span><br><span class="line"> 3        谈谈怎样入门大数据 </span><br><span class="line"> 4        谈谈怎样做好一个大数据平台的运营工作 </span><br><span class="line"> 5        Linux机器,各软件版本介绍及安装(录播) </span><br><span class="line"> 6    2.Introduction      </span><br><span class="line"> 7        Cloudera、CM及CDH介绍 </span><br><span class="line"> 8        CDH版本选择 </span><br><span class="line"> 9        CDH安装几种方式解读 </span><br><span class="line">10    3.Install&amp;UnInstall  </span><br><span class="line">11        集群节点规划,环境准备(NTP,Jdk and etc) </span><br><span class="line">12        MySQL编译安装及常用命令 </span><br><span class="line">13        推荐:CDH离线安装(踩坑心得,全面剖析) </span><br><span class="line">14        解读暴力卸载脚本 </span><br><span class="line">15    4.CDH Management      </span><br><span class="line">16        CDH体系架构剖析 </span><br><span class="line">17        CDH配置文件深度解析 </span><br><span class="line">18        CM的常用命令 </span><br><span class="line">19        CDH集群正确启动和停止顺序 </span><br><span class="line">20        CDH Tsquery Language </span><br><span class="line">21        CDH常规管理(监控/预警/配置/资源/日志/安全) </span><br><span class="line">22    5.Maintenance Experiment  </span><br><span class="line">23        HDFS HA 配置 及hadoop/hdfs常规命令 </span><br><span class="line">24        Yarn HA 配置 及yarn常规命令 </span><br><span class="line">25        Other CDH Components HA 配置 </span><br><span class="line">26        CDH动态添加删除服务(hive/spark/hbase) </span><br><span class="line">27        CDH动态添加删除机器 </span><br><span class="line">28        CDH动态添加删除及迁移DataNode进程等 </span><br><span class="line">29        CDH升级(5.10.0--&gt;5.12.0) </span><br><span class="line">30    6.Resource Management    </span><br><span class="line">31        Linux Cgroups </span><br><span class="line">32        静态资源池 </span><br><span class="line">33        动态资源池 </span><br><span class="line">34        多租户案例 </span><br><span class="line">35    7.Performance Tunning    </span><br><span class="line">36        Memory/CPU/Network/Disk及集群规划 </span><br><span class="line">37        Linux参数 </span><br><span class="line">38        HDFS参数 </span><br><span class="line">39        MapReduce及Yarn参数 </span><br><span class="line">40        其他服务参数 </span><br><span class="line">41    8.Cases Share        </span><br><span class="line">42        CDH4&amp;5之Alternatives命令 的研究 </span><br><span class="line">43        CDH5.8.2安装之Hash verification failed </span><br><span class="line">44        记录一次CDH4.8.6 配置HDFS HA 坑 </span><br><span class="line">45        CDH5.0集群IP更改 </span><br><span class="line">46        CDH的active namenode exit(GC)和彩蛋分享 </span><br><span class="line">47    9. Kerberos     </span><br><span class="line">48        Kerberos简介</span><br><span class="line">49        Kerberos体系结构</span><br><span class="line">50        Kerberos工作机制</span><br><span class="line">51        Kerberos安装部署</span><br><span class="line">52        CDH启用kerberos</span><br><span class="line">53        Kerberos开发使用(真实代码)</span><br><span class="line">54    10.Summary         </span><br><span class="line">55        总结</span><br></pre></td></tr></table></figure>
<hr>
<h4 id="Join-us-if-you-have-a-dream"><a href="#Join-us-if-you-have-a-dream" class="headerlink" title="Join us if you have a dream."></a>Join us if you have a dream.</h4><h5 id="若泽数据官网"><a href="#若泽数据官网" class="headerlink" title="若泽数据官网"></a><span class="exturl" data-url="aHR0cDovL3J1b3plZGF0YS5jb20=" title="http://ruozedata.com">若泽数据官网<i class="fa fa-external-link"></i></span></h5><h5 id="腾讯课堂，搜若泽数据"><a href="#腾讯课堂，搜若泽数据" class="headerlink" title="腾讯课堂，搜若泽数据"></a><span class="exturl" data-url="aHR0cDovL3J1b3plLmtlLnFxLmNvbQ==" title="http://ruoze.ke.qq.com">腾讯课堂，搜若泽数据<i class="fa fa-external-link"></i></span></h5><h5 id="Bilibili网站-搜若泽数据"><a href="#Bilibili网站-搜若泽数据" class="headerlink" title="Bilibili网站,搜若泽数据"></a><span class="exturl" data-url="aHR0cHM6Ly9zcGFjZS5iaWxpYmlsaS5jb20vMzU2ODM2MzIz" title="https://space.bilibili.com/356836323">Bilibili网站,搜若泽数据<i class="fa fa-external-link"></i></span></h5><h5 id="若泽大数据–官方博客"><a href="#若泽大数据–官方博客" class="headerlink" title="若泽大数据–官方博客"></a><span class="exturl" data-url="aHR0cHM6Ly9ydW96ZWRhdGEuZ2l0aHViLmlv" title="https://ruozedata.github.io">若泽大数据–官方博客<i class="fa fa-external-link"></i></span></h5><h5 id="若泽大数据–博客一览"><a href="#若泽大数据–博客一览" class="headerlink" title="若泽大数据–博客一览"></a><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3J1b3plZGF0YS9CaWdEYXRhL2Jsb2IvbWFzdGVyL2Jsb2cvQmlnRGF0YUJsb2dPdmVydmlldy5tZA==" title="https://github.com/ruozedata/BigData/blob/master/blog/BigDataBlogOverview.md">若泽大数据–博客一览<i class="fa fa-external-link"></i></span></h5><h5 id="若泽大数据–内部学员面试题"><a href="#若泽大数据–内部学员面试题" class="headerlink" title="若泽大数据–内部学员面试题"></a><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3J1b3plZGF0YS9CaWdEYXRhL2Jsb2IvbWFzdGVyL2ludGVydmlldy8lRTUlQjglQjglRTglQTclODElRTklOUQlQTIlRTglQUYlOTUlRTklQTIlOTgubWQ=" title="https://github.com/ruozedata/BigData/blob/master/interview/%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98.md">若泽大数据–内部学员面试题<i class="fa fa-external-link"></i></span></h5>
      
    </div>

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/CDH5-16-1/" rel="tag"><i class="fa fa-tag"></i> CDH5.16.1</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div class="social_share">
            
              <div>
                

<script src="//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.js"></script>



<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.css">


  


<div class="likely likely-light">
	
 	 	<div class="twitter">Tweet</div>
	
 	 	<div class="facebook">Share</div>
	
 	 	<div class="linkedin">Link</div>
	
 	 	<div class="gplus">Plus</div>
	
 	 	<div class="vkontakte">Share</div>
	
 	 	<div class="odnoklassniki">Class</div>
	
 	 	<div class="telegram">Send</div>
	
 	 	<div class="whatsapp">Send</div>
	
 	 	<div class="pinterest">Pin</div>
	
</div>

              </div>
            
            
            
              <div>
                
  <div class="bdsharebuttonbox">
    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
    <a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a>
    <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
    <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
    <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
    <a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧"></a>
    <a href="#" class="bds_twi" data-cmd="twi" title="分享到Twitter"></a>
    <a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a>
    <a href="#" class="bds_more" data-cmd="more"></a>
    <a class="bds_count" data-cmd="count"></a>
  </div>
  <script>
    window._bd_share_config = {
      "common": {
        "bdText": "",
        "bdMini": "2",
        "bdMiniList": false,
        "bdPic": ""
      },
      "share": {
        "bdSize": "16",
        "bdStyle": "0"
      },
      "image": {
        "viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
        "viewText": "分享到：",
        "viewSize": "16"
      }
    }
  </script>

<script>
  with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
</script>

              </div>
            
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/一次Java线程池误用引发的血案和总结.html" rel="next" title="一次Java线程池误用引发的血案和总结">
                <i class="fa fa-chevron-left"></i> 一次Java线程池误用引发的血案和总结
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/centos7-5-Ambari2-7-3部署安装.html" rel="prev" title="centos7.5+Ambari2.7.3部署安装">
                centos7.5+Ambari2.7.3部署安装 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8yOTk3My82NTM4"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="https://hexoblog-1254111960.cos.ap-guangzhou.myqcloud.com/HexoBlog-tou.jpg" alt="Daniel X">
            
              <p class="site-author-name" itemprop="name">Daniel X</p>
              <div class="site-description motion-element" itemprop="description">專注于大数据技術，分享干货</div>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">125</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  
                    
                      <a href="/categories">
                    
                  
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">15</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  
                    
                      <a href="/tags">
                    
                  
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">63</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  
                  
                    
                  
                  
                    
                  
                  <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2R1ZGVmdQ==" title="GitHub &rarr; https://github.com/dudefu"><i class="fa fa-fw fa-github"></i>GitHub</span>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                    
                  
                  
                    
                  
                  <span class="exturl" data-url="bWFpbHRvOmR1ZGVmdUBmb3htYWlsLmNvbT9zdWJqZWN0PUhlbGxvJTIwYWdhaW4=" title="E-mail &rarr; mailto:dudefu@foxmail.com?subject=Hello%20again"><i class="fa fa-fw fa-envelope"></i>E-mail</span>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                    
                  
                  
                    
                  
                  <span class="exturl" data-url="aHR0cHM6Ly93ZWliby5jb20vZHVkZWZ1" title="Weibo &rarr; https://weibo.com/dudefu"><i class="fa fa-fw fa-weibo"></i>Weibo</span>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                    
                  
                  
                    
                  
                  <span class="exturl" data-url="aHR0cHM6Ly93cGEucXEuY29tL21zZ3JkP3Y9MyZ1aW49MTU3NzU3MTk1OSZzaXRlPWR1ZGVmdS5pbmZvJm1lbnU9eWVz" title="QQ &rarr; https://wpa.qq.com/msgrd?v=3&uin=1577571959&site=dudefu.info&menu=yes"><i class="fa fa-fw fa-qq"></i>QQ</span>
                </span>
              
            </div>
          

          

          
          

          
            
          
          

        </div>
      </div>

      
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#一-准备工作"><span class="nav-number">1.</span> <span class="nav-text">一.准备工作</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-离线部署主要分为三块"><span class="nav-number">1.0.1.</span> <span class="nav-text">1.离线部署主要分为三块:</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-规划"><span class="nav-number">1.0.2.</span> <span class="nav-text">2.规划:</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-下载源"><span class="nav-number">1.1.</span> <span class="nav-text">3.下载源:</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#准备好百度云-下载安装包"><span class="nav-number">1.2.</span> <span class="nav-text">准备好百度云,下载安装包:</span></a></li></ol><li class="nav-item nav-level-2"><a class="nav-link" href="#二-集群节点初始化"><span class="nav-number">2.</span> <span class="nav-text">二.集群节点初始化</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-阿里云上海区购买3台，按量付费虚拟机"><span class="nav-number">2.1.</span> <span class="nav-text">1.阿里云上海区购买3台，按量付费虚拟机</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-当前笔记本或台式机配置hosts文件"><span class="nav-number">2.2.</span> <span class="nav-text">2.当前笔记本或台式机配置hosts文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-设置所有节点的hosts文件"><span class="nav-number">2.3.</span> <span class="nav-text">3.设置所有节点的hosts文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-关闭所有节点的防火墙及清空规则"><span class="nav-number">2.4.</span> <span class="nav-text">4.关闭所有节点的防火墙及清空规则</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-关闭所有节点的selinux"><span class="nav-number">2.5.</span> <span class="nav-text">5.关闭所有节点的selinux</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-设置所有节点的时区一致及时钟同步"><span class="nav-number">2.6.</span> <span class="nav-text">6.设置所有节点的时区一致及时钟同步</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#查看命令帮助，学习至关重要，无需百度，太👎"><span class="nav-number">2.6.0.1.</span> <span class="nav-text">查看命令帮助，学习至关重要，无需百度，太👎</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#查看哪些时区"><span class="nav-number">2.6.0.2.</span> <span class="nav-text">查看哪些时区</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#所有节点设置亚洲上海时区"><span class="nav-number">2.6.0.3.</span> <span class="nav-text">所有节点设置亚洲上海时区</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#所有节点安装ntp"><span class="nav-number">2.6.0.4.</span> <span class="nav-text">所有节点安装ntp</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#选取hadoop001为ntp的主节点"><span class="nav-number">2.6.0.5.</span> <span class="nav-text">选取hadoop001为ntp的主节点</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#time"><span class="nav-number">2.6.0.6.</span> <span class="nav-text">time</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#当外部时间不可用时，可使用本地硬件时间"><span class="nav-number">2.6.0.7.</span> <span class="nav-text">当外部时间不可用时，可使用本地硬件时间</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#允许哪些网段的机器来同步时间"><span class="nav-number">2.6.0.8.</span> <span class="nav-text">允许哪些网段的机器来同步时间</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#开启ntpd及查看状态"><span class="nav-number">2.6.0.9.</span> <span class="nav-text">开启ntpd及查看状态</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#验证"><span class="nav-number">2.6.0.10.</span> <span class="nav-text">验证</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#其他从节点停止禁用ntpd服务"><span class="nav-number">2.6.0.11.</span> <span class="nav-text">其他从节点停止禁用ntpd服务</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#每天凌晨同步hadoop001节点时间"><span class="nav-number">2.6.0.12.</span> <span class="nav-text">每天凌晨同步hadoop001节点时间</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-部署集群的JDK"><span class="nav-number">2.7.</span> <span class="nav-text">7.部署集群的JDK</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#8-hadoop001节点离线部署MySQL5-7-假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档"><span class="nav-number">2.8.</span> <span class="nav-text">8.hadoop001节点离线部署MySQL5.7(假如觉得困难哟，就自行百度RPM部署，因为该部署文档是我司生产文档)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#9-创建CDH的元数据库和用户、amon服务的数据库及用户"><span class="nav-number">2.9.</span> <span class="nav-text">9.创建CDH的元数据库和用户、amon服务的数据库及用户</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#10-hadoop001节点部署mysql-jdbc-jar"><span class="nav-number">2.10.</span> <span class="nav-text">10.hadoop001节点部署mysql jdbc jar</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三-CDH部署"><span class="nav-number">3.</span> <span class="nav-text">三.CDH部署</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-离线部署cm-server及agent"><span class="nav-number">3.1.</span> <span class="nav-text">1.离线部署cm server及agent</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-hadoop001节点部署离线parcel源"><span class="nav-number">3.2.</span> <span class="nav-text">2.hadoop001节点部署离线parcel源</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-所有节点创建软件安装目录、用户及用户组权限"><span class="nav-number">3.3.</span> <span class="nav-text">3.所有节点创建软件安装目录、用户及用户组权限</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-hadoop001节点启动Server"><span class="nav-number">3.4.</span> <span class="nav-text">4.hadoop001节点启动Server</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-所有节点启动Agent"><span class="nav-number">3.5.</span> <span class="nav-text">5.所有节点启动Agent</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-接下来，全部Web界面操作"><span class="nav-number">3.6.</span> <span class="nav-text">6.接下来，全部Web界面操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-欢迎使用Cloudera-Manager–最终用户许可条款与条件。勾选"><span class="nav-number">3.7.</span> <span class="nav-text">7.欢迎使用Cloudera Manager–最终用户许可条款与条件。勾选</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#8-欢迎使用Cloudera-Manager–您想要部署哪个版本？选择Cloudera-Express免费版本"><span class="nav-number">3.8.</span> <span class="nav-text">8.欢迎使用Cloudera Manager–您想要部署哪个版本？选择Cloudera Express免费版本</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#9-感谢您选择Cloudera-Manager和CDH"><span class="nav-number">3.9.</span> <span class="nav-text">9.感谢您选择Cloudera Manager和CDH</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#10-为CDH集群安装指导主机。选择-当前管理的主机-，全部勾选"><span class="nav-number">3.10.</span> <span class="nav-text">10.为CDH集群安装指导主机。选择[当前管理的主机]，全部勾选</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#11-选择存储库"><span class="nav-number">3.11.</span> <span class="nav-text">11.选择存储库</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#12-集群安装–正在安装选定Parcel假如"><span class="nav-number">3.12.</span> <span class="nav-text">12.集群安装–正在安装选定Parcel假如</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#13-检查主机正确性"><span class="nav-number">3.13.</span> <span class="nav-text">13.检查主机正确性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#14-自定义服务，选择部署Zookeeper、HDFS、Yarn服务"><span class="nav-number">3.14.</span> <span class="nav-text">14.自定义服务，选择部署Zookeeper、HDFS、Yarn服务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#15-自定义角色分配"><span class="nav-number">3.15.</span> <span class="nav-text">15.自定义角色分配</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#16-数据库设置"><span class="nav-number">3.16.</span> <span class="nav-text">16.数据库设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#17-审改设置，默认即可"><span class="nav-number">3.17.</span> <span class="nav-text">17.审改设置，默认即可</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#18-首次运行"><span class="nav-number">3.18.</span> <span class="nav-text">18.首次运行</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#19-恭喜您"><span class="nav-number">3.19.</span> <span class="nav-text">19.恭喜您!</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#20-主页"><span class="nav-number">3.20.</span> <span class="nav-text">20.主页</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#CDH全套课程目录，如有buy，加微信-ruoze-star"><span class="nav-number">3.21.</span> <span class="nav-text">CDH全套课程目录，如有buy，加微信(ruoze_star)</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Join-us-if-you-have-a-dream"><span class="nav-number">3.21.1.</span> <span class="nav-text">Join us if you have a dream.</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#若泽数据官网"><span class="nav-number">3.21.1.1.</span> <span class="nav-text">若泽数据官网</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#腾讯课堂，搜若泽数据"><span class="nav-number">3.21.1.2.</span> <span class="nav-text">腾讯课堂，搜若泽数据</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Bilibili网站-搜若泽数据"><span class="nav-number">3.21.1.3.</span> <span class="nav-text">Bilibili网站,搜若泽数据</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#若泽大数据–官方博客"><span class="nav-number">3.21.1.4.</span> <span class="nav-text">若泽大数据–官方博客</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#若泽大数据–博客一览"><span class="nav-number">3.21.1.5.</span> <span class="nav-text">若泽大数据–博客一览</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#若泽大数据–内部学员面试题"><span class="nav-number">3.21.1.6.</span> <span class="nav-text">若泽大数据–内部学员面试题</span></a></li></ol></li></ol></li></ol></li></div>
            

          </div>
        </div>
      <!--/noindex-->
      

      

    </div>
  </aside>
  


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">  <span class="exturl" data-url="aHR0cDovL3d3dy5iZWlhbi5taWl0Lmdvdi5jbg==">粤ICP备18110871号 </span>&copy; 2017 – <span itemprop="copyrightYear">2021</span>
  <span class="with-love" id="animate">
    <i class="fa fa-spinner"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">dudefu</span>

  

  
</div>

<!--

  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> 强力驱动 v3.8.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Pisces</span> v7.1.2</div>

-->



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

    

    
  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>














  
    
    
      
    
  
  <script color="26,26,26" opacity="0.5" zindex="-1" count="99" src="//cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-nest@1/canvas-nest.min.js"></script>









  
  
  <script id="ribbon" size="300" alpha="0.6" zindex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>



  



  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script src="/lib/reading_progress/reading_progress.js"></script>


  


  <script src="/js/utils.js?v=7.1.2"></script>

  <script src="/js/motion.js?v=7.1.2"></script>



  
  


  <script src="/js/affix.js?v=7.1.2"></script>

  <script src="/js/schemes/pisces.js?v=7.1.2"></script>



  
  <script src="/js/scrollspy.js?v=7.1.2"></script>
<script src="/js/post-details.js?v=7.1.2"></script>



  


  <script src="/js/next-boot.js?v=7.1.2"></script>


  
  <script src="/js/js.cookie.js?v=7.1.2"></script>
  <script src="/js/scroll-cookie.js?v=7.1.2"></script>


  
  <script src="/js/exturl.js?v=7.1.2"></script>


  

  
  

<script src="//cdn1.lncld.net/static/js/3.11.1/av-min.js"></script>



<script src="//unpkg.com/valine/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: true,
    notify: true,
    appId: '1N5rpk874DGudJw2wCL9J011-gzGzoHsz',
    appKey: '9Y83e6suJgx567wtxhKy45IN',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zk-cn' || 'zh-cn'
  });
</script>




  
    <script>
  window.livereOptions = {
    refer: 'CDH5-16-1集群企业真正离线部署.html'
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
</script>

  


  
  <script>
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url).replace(/\/{2,}/g, '/');
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x"></i></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x"></i></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script src="https://www.gstatic.com/firebasejs/4.6.0/firebase.js"></script>
  <script src="https://www.gstatic.com/firebasejs/4.6.0/firebase-firestore.js"></script>
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.5.1/bluebird.core.min.js"></script>
  
  <script>
    (function () {

      firebase.initializeApp({
        apiKey: '',
        projectId: ''
      })

      function getCount(doc, increaseCount) {
        //increaseCount will be false when not in article page

        return doc.get().then(function (d) {
          var count
          if (!d.exists) { //has no data, initialize count
            if (increaseCount) {
              doc.set({
                count: 1
              })
              count = 1
            }
            else {
              count = 0
            }
          }
          else { //has data
            count = d.data().count
            if (increaseCount) {
              if (!(window.localStorage && window.localStorage.getItem(title))) { //if first view this article
                doc.set({ //increase count
                  count: count + 1
                })
                count++
              }
            }
          }
          if (window.localStorage && increaseCount) { //mark as visited
            localStorage.setItem(title, true)
          }

          return count
        })
      }

      function appendCountTo(el) {
        return function (count) {
          $(el).append(
            $('<span>').addClass('post-visitors-count').append(
              $('<span>').addClass('post-meta-divider').text('|')
            ).append(
              $('<span>').addClass('post-meta-item-icon').append(
                $('<i>').addClass('fa fa-users')
              )
              ).append($('<span>').text('阅读次数 ' + count))
          )
        }
      }

      var db = firebase.firestore()
      var articles = db.collection('articles')

      //https://hexo.io/docs/variables.html
      var isPost = 'CDH5.16.1集群企业真正离线部署'.length > 0
      var isArchive = '' === 'true'
      var isCategory = ''.length > 0
      var isTag = ''.length > 0

      if (isPost) { //is article page
        var title = 'CDH5.16.1集群企业真正离线部署'
        var doc = articles.doc(title)

        getCount(doc, true).then(appendCountTo($('.post-meta')))
      }
      else if (!isArchive && !isCategory && !isTag) { //is index page
        var titles = [] //array to titles

        var postsstr = '' //if you have a better way to get titles of posts, please change it
        eval(postsstr)

        var promises = titles.map(function (title) {
          return articles.doc(title)
        }).map(function (doc) {
          return getCount(doc)
        })
        Promise.all(promises).then(function (counts) {
          var metas = $('.post-meta')
          counts.forEach(function (val, idx) {
            appendCountTo(metas[idx])(val)
          })
        })
      }
    })()
  </script>


  
  

  
  

  


  
<script>
if ($('body').find('div.pdf').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      $('body').find('div.pdf').each(function(i, o) {
        PDFObject.embed($(o).attr('target'), $(o), {
          pdfOpenParams: {
            navpanes: 0,
            toolbar: 0,
            statusbar: 0,
            pagemode: 'thumbs',
            view: 'FitH'
          },
          PDFJS_URL: '/lib/pdf/web/viewer.html',
          height: $(o).attr('height') || '500px'
        });
      });
    },
  });
}
</script>


  
<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'dark',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>


  

  

  

  

  
  
  
  <script src="/lib/bookmark/bookmark.min.js?v=1.0"></script>
  <script>
  
    bookmark.scrollToMark('auto', "#更多");
  
  </script>


  
<script>
  $('.highlight').not('.gist .highlight').each(function(i, e) {
    var $wrap = $('<div>').addClass('highlight-wrap');
    $(e).after($wrap);
    $wrap.append($('<button>').addClass('copy-btn').append('复制').on('click', function(e) {
      var code = $(this).parent().find('.code').find('.line').map(function(i, e) {
        return $(e).text();
      }).toArray().join('\n');
      var ta = document.createElement('textarea');
      var yPosition = window.pageYOffset || document.documentElement.scrollTop;
      ta.style.top = yPosition + 'px'; // Prevent page scroll
      ta.style.position = 'absolute';
      ta.style.opacity = '0';
      ta.readOnly = true;
      ta.value = code;
      document.body.appendChild(ta);
      const selection = document.getSelection();
      const selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
      ta.select();
      ta.setSelectionRange(0, code.length);
      ta.readOnly = false;
      var result = document.execCommand('copy');
      
        if (result) $(this).text('复制成功');
        else $(this).text('复制失败');
      
      ta.blur(); // For iOS
      $(this).blur();
      if (selected) {
        selection.removeAllRanges();
        selection.addRange(selected);
      }
    })).on('mouseleave', function(e) {
      var $b = $(this).find('.copy-btn');
      setTimeout(function() {
        $b.text('复制');
      }, 300);
    }).append(e);
  })
</script>


  

  

</body>
</html>
